package com.salt.system.enums;

import com.fasterxml.jackson.annotation.JsonFormat;

import java.util.StringJoiner;

/**
 * 用户状态
 *
 * @author HaiBo Kuang
 * @date 2021年04月20日 下午 17:32
 */
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum SysUserState {
    /**
     * 正常状态
     */
    NONE(0, "无效状态"),
    NORMAL(1, "正常"),
    BANDED(2, "锁定"),
    DELETED(3, "删除"),
    EXPIRED(4, "过期");
    private final Integer state;
    private final String desc;

    SysUserState(Integer state, String desc) {
        this.state = state;
        this.desc = desc;
    }

    public Integer getState() {
        return state;
    }

    public String getDesc() {
        return desc;
    }

    @Override
    public String toString() {
        return new StringJoiner(", ", SysUserState.class.getSimpleName() + "[", "]")
                .add("state=" + state)
                .add("desc='" + desc + "'")
                .toString();
    }
}
